import {Button, message, Upload} from "antd";
import {UploadOutlined} from "@ant-design/icons";


function DemoDataList() {
  const props = {
    name: 'file',
    action: '/api/csv/upload',
    multiple:true,
    onChange(info: any) {
      if (info.file.status !== 'uploading') {
        console.log(info.file, info.fileList);
      }
      if (info.file.status === 'done') {
        message.success(`${info.file.name} file uploaded successfully`);
      } else if (info.file.status === 'error') {
        message.error(`${info.file.name} file upload failed.`);
      }
    },
  };
  return (
    <div>
      <Upload {...props}>
        <Button icon={<UploadOutlined/>}>Click to Upload</Button>
      </Upload>

    </div>
  )
}

export default DemoDataList;


